/*
 * Exception.h
 *
 *  Created on: May 7, 2011
 *      Author: xrose
 */

#ifndef EXCEPTION_H_
#define EXCEPTION_H_
#include <string>
class Exception : std::exception{
public:
	Exception(){}
	Exception(const std::string& sError) throw(): error(sError){
		if(error.size() > 0)
			std::cerr << error <<std::endl;
	}
	virtual const std::string& getError() const throw() {return error;}
	virtual const char* what() const throw() {return getError().c_str();}
	virtual ~Exception() throw() {}
protected:
	std::string error;
};

#endif /* EXCEPTION_H_ */
